package org.mxp.demo10;

import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import org.mxp.utils.RabbitMQUtils;

import java.util.HashMap;
import java.util.Map;

public class ReceiveObj {
    public static void main(String[] args) throws Exception {
        // 队列的名称
        String QUEUE_NAME = "test_queue";

        // 获取信道
        Channel channel = RabbitMQUtils.getChannel();
        // 队列接受消息
        channel.basicConsume(QUEUE_NAME, true, (consumerTag, message) -> {
            System.out.println(QUEUE_NAME + "接受到消息：" + new String(message.getBody()));
        }, (consumerTag) -> {});
    }
}
